<template>
  <div v-if="Object.keys(comment).length !== 0" class="comment-info">
    <div class="info-header">
      <div class="header-title">用户评价</div>
        <div class="header-more">更多
          <i class="arrow-right"></i>
        </div>
    </div>
    <div class="info-user">
      <img :src="comment.user.avatar" alt="">
      <span>{{comment.user.uname}}</span>
    </div>
    <div class="info-detail">
      <p>{{comment.content}}</p>
      <div class="info-other">
        <span>{{comment.created|showDate}}</span>
        <span>{{comment.style}}</span>
      </div>
      <div class="info-imgs ">
        <img :src="item" v-for="(item, index) in comment.images">
      </div>
    </div>
  </div>

</template>

<script>
  import {formatDate} from 'common/utils.js'
  export default{
    name:'',
    data(){
      return {

       }
    },
    props:{
      comment:{
        type:Object,
        default(){
          return {}
        }
      }
    },
    filters:{
      showDate(value){
        let date=new Date(value*1000)
        return formatDate(date,'yyyy-MM-dd')
      }
    },
    methods:{

    },
    components:{

    }
  }
</script>

<style scoped>
  .comment-info{
    width: 90%;
    margin: 20px auto;
  }
  .info-header{
    border-bottom: 3px solid #666666;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
  }
  .header-title{
    font-size: 20px;
  }
  .header-more{
    font-size: 17px;
  }
  .info-user{
    position: relative;
  }
  .info-user img{
    height: 45px;
    width: 45px;
    border-radius: 50%;
    margin-right: 10px;
    margin-bottom: 5px;
  }
  .info-user span{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }
  .info-detail{
    line-height: 25px;
  }
  .info-other span{
    font-size: 10px;
    color: #666666;
  }
  .info-imgs{
    display: flex;
  }
  .info-imgs img{
    height: 35px;
    width: 35px;
  }
</style>
